//纯方法进行状态的描述
const counter = (state = {count:155,switch:true},action)=>{
    const addCount = state.count;
    switch(action.type){
        case 'abc':
            return Object.assign({},state,{
                count:addCount + 1
            });
        break;
        case 'switchBtnY':
            return Object.assign({},state,{
                switch:true
            });
        break;
        case 'switchBtnN':
            return Object.assign({},state,{
                switch:false
            });
        default:return state;
    }
};
export default counter;